// px转rem
@function r($px) {
  @return $px/108+rem
}

// 超出长度。。。
@mixin ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

//  居中背景图
@mixin bg($url) {
  background-image: url($url);
  background-position: center center;
  background-repeat: no-repeat;
  display: block;
  background-size: contain;
}

// 上下垂直居中
@mixin center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

// 图片外层
@mixin imgwrap($w, $h) {
  width: $w;
  height: $h;
  display: flex;
  justify-content: center;
  align-items: center;
  img {
    width: 100%;
    height: 100%;
  }
}